package com.czhi.consumer.service;


import com.czhi.common.api.CallServiceApi;
import com.czhi.common.api.DubboCloudApi;
import org.apache.dubbo.config.annotation.Reference;
import org.apache.dubbo.config.annotation.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.ws.rs.GET;
import javax.ws.rs.Path;


@Service(interfaceClass = CallServiceApi.class, protocol = {"rest","dubbo"})
@Path("/")
public class CallService implements CallServiceApi {

    private static final Logger log = LoggerFactory.getLogger(CallService.class);

    @Reference(interfaceClass = DubboCloudApi.class)
    private DubboCloudApi dubboCloudApi;


    @Override
    @Path("/info")
    @GET
    public String call() {
        log.info("consumer调用了");
        String message = dubboCloudApi.getMessage();
        return "";
    }
}
